<template>
  <div class="welcome">
    <el-table :data="logData"
              border
              style="width: 100%">
      <!-- 代表登入账户这一列 -->
      <!-- prop代表数据的来源logdata中的属性 -->
      <el-table-column prop="username"
                       label="登入账户"
                       align='center'
                       width="180">
      </el-table-column>
      <!-- 代表上次登入ip这一列 -->
      <el-table-column prop="lastLogin.ip"
                       label="上次登入ip"
                       align='center'
                       width="180">
      </el-table-column>
      <!-- sortable按照时间来排序 -->
      <el-table-column prop="lastLogin.loginTime"
                       align='center'
                       sortable
                       label="上次登入时间">
      </el-table-column>
      <el-table-column prop="nowLogin.ip"
                       align='center'
                       label="本次登入ip">
      </el-table-column>
      <el-table-column prop="nowLogin.loginTime"
                       align='center'
                       label="本次登入时间">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
  import { getloginlog } from "../../../api"
  export default {
    created() {
      getloginlog(this).then((res) => {
        this.logData = res.data.data;
      })
    },

    data() {
      return {
        logData: []
      }
    },
    components: {
    }
  }

</script>

<style lang='scss' scoped>
</style>
